package com.vrp3d.domain.dto.user;

import com.vrp3d.common.consts.CommonConst;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * 用户密码登录DTO
 *
 * @author vrp3d
 */
@Data
public class UserForLoginDTO implements Serializable {

    private static final long serialVersionUID = 7257665594577029133L;

    /**
     * 用户名
     */
    @ApiModelProperty(value = "手机号/邮箱", required = true)
    @NotBlank(message = "请输入正确的手机号或邮箱")
    @Pattern(regexp = CommonConst.PHONE_REGEX, message = "请输入正确的手机号或邮箱")
    private String username;

    /**
     * 密码
     */
    @ApiModelProperty(value = "密码", required = true)
    @NotBlank(message = "密码不能为空")
    @Pattern(regexp = CommonConst.PASSWORD_REGULAR, message = "密码不符合规范")
    private String password;

}
